package com.itboye.textileexpres.logincontroller;



import com.itboye.textileexpres.util.DebugLog;

import android.app.Activity;
import android.app.Fragment;
/**
 * 登录相关控制类--状态模式</br></br>
 * 
 * 登录成功后调用setLoginState(new LoginedState());</br></br>
 * 退出登录后调用setLoginState(new UnLoginState());</br></br>
 * 进入主Activity前一定要设置一次，要么登录要么未登录</br></br>
 * @author Mr.w
 *
 */
public class LoginController {

	private static ILoginState loginState=new UnLoginState();

	public static void setLoginState(ILoginState loginState) {
			
		LoginController.loginState = loginState;
		if (loginState instanceof UnLoginState) {
			DebugLog.v("bytag", "未登录。。。");
		}else if (loginState instanceof LoginedState) {
			DebugLog.v("bytag", "已登录。。。");
		}
	}

	
	public static void testClick(Activity act,Object data) {
		loginState.test(act,data);
	}
	public static void onPersonalData(Activity act,Object data) {
		loginState.onPersonalData(act,data);
	}
	/**
	 * 个人喜好
	 * @param act
	 * @param data
	 */
	public static void onFavoriteData(Activity act,Object data) {
		loginState.onFavoriteData(act,data);
	}
	
}
